'''
Created on 21.11.2013

@author: Danila OLeynik
'''
from django.db import models

from BasicObject import BaseObject
from Params import MaritalStatus, Title, Profession, Language, Countrie
from Syndic import Syndic


class Contact(BaseObject):
    '''
    Contact model description
    '''
    syndic = models.ForeignKey(Syndic, related_name='contacts_syndic')
    parent = models.ForeignKey('self', null=True)
    pref_language = models.ForeignKey(Language, null=True)
    profession = models.ForeignKey(Profession, null=True)
    title = models.ForeignKey(Title, null=True)
    marital_status = models.ForeignKey(MaritalStatus, null=True)
    nationality = models.ForeignKey(Countrie, null=True)
    first_name = models.CharField(max_length=50)
    last_name = models.CharField(max_length=50, null=True)
    greetings_form = models.CharField(max_length=50)
    website  = models.URLField()
    birth_date = models.DateField(null=True)
    vat_flag = models.BooleanField(default=False)
    vat_number = models.CharField(max_length=50)
    #photo = models.FileField()
    rating = models.DecimalField(max_digits=6, decimal_places=2)
    rating_note = models.CharField(max_length=50)
    
    class Meta:
        app_label = 'condo'
    
class Address(BaseObject):
    '''
    Addresses for contact
    '''
    contact = models.ForeignKey(Contact)
    country = models.ForeignKey(Countrie, null=True)
    address = models.CharField(max_length=50)
    address_2 = models.CharField(max_length=50, null=True)
    po_box = models.CharField(max_length=10, null=True)
    
    class Meta:
        app_label = 'condo'
